from flask_wtf import FlaskForm
from flask_wtf.file import FileRequired, FileAllowed
from wtforms import StringField, FloatField, TextAreaField, FileField, SubmitField
from wtforms.validators import DataRequired


class ArticleForm(FlaskForm):
    arc_name = StringField('name', validators=[DataRequired()])
    arc_content = TextAreaField('content', validators=[DataRequired()])
    arc_location = TextAreaField('location')
    arc_longtitude = FloatField('longtitude')
    arc_latitude = FloatField('latitude')
    arc_file = FileField('File', validators=[FileAllowed(['jpg'])])
    submit = SubmitField('发布帖子')
